<?php
include '../dbconnect.php';

// 获取员工ID
$uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : '';
if (empty($uid)) {
    echo "员工ID不能为空！";
    exit;
}

// 使用预处理语句进行软删除
$sql = "UPDATE staff SET IS_DELETE = 1 WHERE S_ID = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $uid);

if ($stmt->execute()) {
    echo "1"; // 软删除成功
} else {
    echo "0"; // 软删除失败
}

$stmt->close();
$conn->close();
?>